import logging,yagmail
def log_set():
    logging.basicConfig(filename='log.txt',filemode='w+',level=logging.DEBUG,format='%(levelname)s->%(asctime)s ->%(message)s'  )
def send_mail(filepath):
    mail=yagmail.SMTP(user='166213731@qq.com',password='jsjqzhaulsgpcbaf',host='smtp.qq.com')
    mail.send(to='166213731@qq.com',subject='测试报告',contents='测试报告，请查收',attachments=filepath)

import yaml,json
def getyamldata(filepath):
    with open(filepath,'r',encoding='utf-8') as f:
        return yaml.safe_load(f)
def getjsondata(filepath):
    with open(filepath,'r',encoding='utf-8') as f:
        return json.load(f)